#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>

int cmp_int(const void* e1, const void* e2)
{
	return *(int*)e2 - *(int*)e1;
}

int main()
{
	int n = 0;
	int i = 0;
	int score[50] = { 0 };

	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &score[i]);
	}

	qsort(score, n, sizeof(score[0]), cmp_int);

	for (i = 0; i < 5; i++)
	{
		printf("%d ", score[i]);
	}

	return 0;
}